package com.xb.loan.encryptor.util;


import com.xb.loan.encryptor.bean.LotteryBean;
import com.xb.loan.encryptor.bean.request.QueryClassReq;
import com.xb.loan.encryptor.bean.request.other.AddPartnerPubKeyReq;
import com.xb.loan.encryptor.bean.request.other.GeneratePartnerKeyReq;
import com.xb.loan.encryptor.bean.request.other.QueryPartnerKeyReq;
import com.xb.loan.encryptor.bean.request.other.QueryUserKeyReq;
import com.xb.loan.encryptor.bean.response.QueryClassRep;
import com.xb.loan.encryptor.bean.response.other.AddPartnerPubKeyRep;
import com.xb.loan.encryptor.bean.response.other.GeneratePartnerKeyRep;
import com.xb.loan.encryptor.bean.response.other.QueryPartnerKeyRep;
import com.xb.loan.encryptor.bean.response.other.QueryUserKeyRep;

import java.util.HashMap;


public class LotteryBeanHelper {
	
	private static final HashMap<String, Class<? extends LotteryBean>> beanClass = new HashMap<String, Class<? extends LotteryBean>>();
	
	static {
		// 请求对应class
		beanClass.put("102", QueryClassReq.class);
		beanClass.put("103", QueryPartnerKeyReq.class);
		beanClass.put("104", QueryUserKeyReq.class);
		beanClass.put("105", GeneratePartnerKeyReq.class);
		beanClass.put("106", AddPartnerPubKeyReq.class);
		
		// 应答对应class
		beanClass.put("702", QueryClassRep.class);
		beanClass.put("703", QueryPartnerKeyRep.class);
		beanClass.put("704", QueryUserKeyRep.class);
		beanClass.put("705", GeneratePartnerKeyRep.class);
		beanClass.put("706", AddPartnerPubKeyRep.class);
	}
	
	public static Class<? extends LotteryBean> getTransCodeClass(String transCode){
		
		return beanClass.get(transCode);
	}
	
}
